package com.juc.function;

import java.util.function.Function;

/**
 * @author yuanzheng
 * @date 2020/8/14-13:25
 */
public class Demo1 {
    public static void main(String[] args) {
        //简化前
        Function<String, String> function1 = new Function<String, String>() {
            @Override
            public String apply(String str) {
                return str;
            }
        };
        //简化后
        Function<String, String> function2 = (str) -> {
            return str;
        };
        System.out.println(function1.apply("test1"));
        System.out.println(function2.apply("test2"));
    }
}
